﻿using System;
using System.Collections.Generic;
using System.Text;
using EnCor.ObjectBuilder;

namespace EnCor.Hosting.WSHosting
{
    
    public class WSHostConfig : FacadeHostConfiguration, IAssembler<FacadeHost, FacadeHostConfiguration>
    {
        #region IAssembler<FacadeHost,HostConfig> Members

        public FacadeHost Assemble(IBuilderContext context, FacadeHostConfiguration objectConfiguration)
        {
            if ( objectConfiguration == null )
            {
                throw new ArgumentNullException("objectConfiguration");
            }
            WSHostConfig config = objectConfiguration as WSHostConfig;
            if ( config == null )
            {
                throw new ArgumentException("the HostConfig object passed to is not a WSHostConfig");
            }
            WSHost host = new WSHost();
            host.Config(config);
            return host;
        }

        #endregion
    }
}
